package com.qtcm.nas.fyx.huiyuantianjia.web;

import com.qtcm.nas.fyx.huiyuantianjia.pojo.*;
import com.qtcm.nas.fyx.huiyuantianjia.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller("memberController")
@RequestMapping("/Member")
public class MemberController {
    @Autowired
    @Qualifier("memberService")
    private IMemberService memberService;

    @RequestMapping("/addhytj")
    public String addMember(Car_fyx car_fyx, MemberShip memberShip, Cz_Cards cz_cards,Orders_fyx orders_fyx){
        memberService.addMember(memberShip);
        int findhyid = memberService.findhyid(memberShip.getC_name());
        car_fyx.setC_membernumber(findhyid);
        memberService.addCar(car_fyx);
        cz_cards.setC_membernumber(findhyid);
        memberService.addCard(cz_cards);
        orders_fyx.setC_membernumber(findhyid);
        memberService.addOrders(orders_fyx);
        return "add_User";
    }
}
